/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-  */
/*
 * catchit
 * Copyright (C) 2013 Ryan Grinkewitz <graphite@Toto>
 * 
 */

#ifndef _PHYSICS_MANAGER_H_
#define _PHYSICS_MANAGER_H_

#include <vector>

#include "constants.h"
#include "jumper.h"
#include "level.h"

class PhysicsManager
{
public:
	static PhysicsManager* getInstance();
	
	bool checkCollision(SDL_Rect* jumperBox, 
                           SDL_Rect* platformBox);
		//outside this, check y velocity for positive as well
	//this will check for a collision with any of the levels
	bool checkCollision(Jumper* jumper, std::vector<Level*> levels);

	void setCurrentTime(int currentTime){this->currentTime = currentTime;};
	int getCurrentTime(){return currentTime;};
	int getLastLevel(){ return lastLevel;};
	void clearLastLevel(){lastLevel = -1;};
	int getLastPlatform(){return lastPlatform;};
	void clearLastPlatform(){lastPlatform = -1;};

protected:


private:
	PhysicsManager(){};
	PhysicsManager(PhysicsManager const&){};
	PhysicsManager& operator=(PhysicsManager const&){};  
	static PhysicsManager* physicsManagerInstance;

	int currentTime;
	int lastLevel;
	int lastPlatform;
};

#endif // _PHYSICS_MANAGER_H_

